<?php
/* SVN FILE: $Id: default.ctp 5844 2007-10-22 01:43:56Z nate $ */
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) :  Rapid Development Framework <http://www.cakephp.org/>
 * Copyright 2005-2007, Cake Software Foundation, Inc.
 *								1785 E. Sahara Avenue, Suite 490-204
 *								Las Vegas, Nevada 89104
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright		Copyright 2005-2007, Cake Software Foundation, Inc.
 * @link				http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
 * @package			cake
 * @subpackage		cake.cake.libs.view.templates.layouts
 * @since			CakePHP(tm) v 0.10.0.1076
 * @version			$Revision: 5844 $
 * @modifiedby		$LastChangedBy: nate $
 * @lastmodified	$Date: 2007-10-22 03:43:56 +0200 (lun., 22 oct. 2007) $
 * @license			http://www.opensource.org/licenses/mit-license.php The MIT License
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <script src="http://www.google.com/jsapi?key=ABQIAAAA6NjQsPsuUjuof6tt6g0ToRQNk9ktrQ7nDrGjpRgOlRQVtdOfDxSYHv7ZXnl3pNV7yibbs-bBg0Pphg" 
 type="text/javascript"></script>

	<title>
		<?php __('VotesBy.Us:'); ?>
		<?php echo $title_for_layout;?>
	</title>

  <?php echo $scripts_for_layout;?>
	<?php echo $html->charset();?>
  <?php echo $javascript->link('prototype');?>
	<?php echo $html->css('votesbyus');?>
</head>
<body>
	<div id="container">
		<div id="header">
		  <table>
		  <tr>
		    <td width="300px">
		      <?php echo $html->image('votesbyus300x71.jpg', array('alt'=> __("VotesBy.US", true), 'border'=>"0"))?>
		    </td>
		    <td>
        "...if we are to guard against ignorance and remain free,
        it is the responsibility of every American to be informed."<br/>
        Thomas Jefferson 
		    </td>
		  </tr></table>
		</div>      
		<div id="content">
            <span class="name"><b><?php echo $session->read('Auth.User.username')?></b></span>
            <table class="frame_table">
              <tr>
                <td>
	                <div class="actions" align="left">
		                <ul>
		                  <li><?php echo $html->link(__('Ballots', true), array('controller' => 'ballots', 'action'=>'view')); ?></li>
		                  <li><?php echo $html->link(__('Search', true), '/pages/search'); ?></li>
		                  <?php if($session->check('Auth.User.username')) : ?>
                        <li><?php echo $html->link(__('Profile', true), array('controller' => 'personal_profiles', 'action' => 'view')); ?> </li>
                      <?php endif;?>
		                </ul>
	                </div>
                </td>
                <td>
	                <div class="actions" align="right">
			              <ul>
			                    <?php if($session->check('Auth.User.username')) : ?>
			                      <?php 
			                      $actions = array(
			                       array('model' => 'Users', 'action' => 'index', 'label' => 'User'),
			                       array('model' => 'Roles', 'action' => 'index', 'label' => 'Role'),
			                       array('model' => 'Roles', 'action' => 'acl', 'label' => 'ACL')
			                      );
			                      foreach ($actions as $action) {
				                      if ($acl->check(array('model' => 'User', 'foreign_key' => $session->read('Auth.User.id')), $action['model'].'/'.$action['action'])) {
				                      	echo '<li>'.$html->link(__($action['label'], true), array('controller' => $action['model'], 'action' => $action['action'])).'</li>';
				                      }
			                      }
			                      ?>
			                      <!-- 
			                        <li><?php echo $html->link(__('Users', true), array('controller' => 'users', 'action'=>'index')); ?></li>
			                        <li><?php echo $html->link(__('Roles', true), array('controller'=> 'roles', 'action'=>'index')); ?> </li>
			                        <li><?php echo $html->link(__('Acl', true), array('controller'=> 'roles', 'action'=>'acl')); ?> </li>            
			                       -->
			                        <li><?php echo $html->link(__('Logout', true), array('controller'=> 'users', 'action'=>'logout')); ?> </li>        
			                    <?php else :?>
			                        <li><?php echo $html->link(__('Login', true), array('controller'=> 'users', 'action'=>'login')); ?> </li>   
			                        <li><?php echo $html->link(__('Register', true), array('controller'=> 'users', 'action'=>'register')); ?> </li>     
			                    <?php endif;?>
			              </ul>
			              </div>
                </td>
              </tr>
            </table>
            <?php
				if ($session->check('Message.flash')):
						$session->flash();
				endif;
                if($session->check('Message.auth'))
                    $session->flash('auth');
            ?>                			
			<?php echo $content_for_layout;?>

		</div>
		
		<div id="footer">
			<?php echo $html->link(
							$html->image('cake.power.gif', array('alt'=> __("CakePHP: the rapid development php framework", true), 'border'=>"0")),
							'http://www.cakephp.org/',
							array('target'=>'_new'), null, false
						);
			?>
		</div>
	</div>
	<?php echo $cakeDebug?>
</body>
</html>
